#!/usr/bin/env python

# [ Imports ]
import os
import sys

from PyQt4 import QtGui
from PyQt4 import QtCore
from clearboard import *

# [ Classes ]
class MainWindow(QtGui.QMainWindow):

    def createExit(self, QtGui):
        exit = QtGui.QAction(QtGui.QIcon('icons/exit.png'), 'Exit', self)
        exit.setShortcut('Ctrl+Q')
        exit.setStatusTip('Exit Clearboard')
        return exit
    
    def createAbout(self, QtGui):
        about = QtGui.QAction(QtGui.QIcon('icons/main.png'), 'About', self)
        about.setShortcut('Ctrl+A')
        about.setStatusTip('About Clearboard')
        return about

    def __init__(self, parent = None):
        ''' Main Window '''
        QtGui.QMainWindow.__init__(self)
        self.resize(650, 325)
        self.setWindowTitle('[ Clearboard ]')
        self.setWindowIcon(QtGui.QIcon('icons/main.png'))
        exit = self.createExit(QtGui)
        about = self.createAbout(QtGui)
        self.connect(exit, QtCore.SIGNAL('triggered()'), QtCore.SLOT('close()'))
        self.statusBar().showMessage('System Ready _')
        # -- Menubar --
        menubar = self.menuBar()
        assualtMenu = menubar.addMenu('&File')
        assualtMenu.addAction(exit)
        helpMenu = menubar.addMenu('&Help!')
        helpMenu.addAction(about)
        # -- Toolbar --
        self.toolbar = self.addToolBar('Exit')
        self.toolbar.addAction(exit)
        

# [ Main ]
if __name__ == '__main__':
    app = QtGui.QApplication(sys.argv)
    main = MainWindow()
    main.show()
    sys.exit(app.exec_())
